package com.itheima.jsonresult;

import lombok.Data;

import java.util.Map;

@Data
public class JsonResult {

    private Integer code;
    private String msg;
    private Object data;
    private Object map;

    public JsonResult() {
    }

    public JsonResult(Integer code, String msg, Object data,Object map) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.map = map;
    }

    public static JsonResult success(Object data){
        return new JsonResult(1,"操作成功",data,null);
    }

    public static JsonResult error(String msg){
        return new JsonResult(0,msg,null,null);
    }


}
